From: Marina Zhurakhinskaya Date: Mon, 5 Oct 2009 17:50:58 +0000 (-0400) Subject: Check that no new term was introduced before doing a subsearch X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~10779 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=aed1e67addc8e9661cb34856d42713d2f1d44a58;p=gnome-shell.git Check that no new term was introduced before doing a subsearch We combine search terms with OR, so if a new search term is introduced, the search results are no longer a subset of the previous search results. --- diff --git a/js/ui/genericDisplay.js b/js/ui/genericDisplay.js index e15df20a4..cbd211fb0 100644 --- a/js/ui/genericDisplay.js +++ b/js/ui/genericDisplay.js @@ -370,7 +370,11 @@ GenericDisplay.prototype = { return; let flags = RedisplayFlags.RESET_CONTROLS; if (this._search != '') { - if (lowertext.indexOf(this._search) == 0) + // Because we combine search terms with OR, we have to be sure that no new term + // was introduced before deciding that the new search results will be a subset of + // the existing search results. + if (lowertext.indexOf(this._search) == 0 && + lowertext.split(/\s+/).length == this._search.split(/\s+/).length) flags |= RedisplayFlags.SUBSEARCH; } this._search = lowertext;